<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
        <title>My City</title>
        <meta http-equiv="cache-control" content="no-cache" />
        <!-- Main style -->
        <link rel="stylesheet" href="/MyCityWeb/css/style.css" type="text/css" />
        <script>
            function validateForm() {
                var x1 = document.forms['RegisterForm']['name'].value;
                var x2 = document.forms['RegisterForm']['sname'].value;
                var x3 = document.forms['RegisterForm']['email'].value;
                var x4 = document.forms['RegisterForm']['username'].value;
                var p1 = document.forms['RegisterForm']['password1'].value;
                var p2 = document.forms['RegisterForm']['password2'].value;
                if (x1 == null || x1 == "" || x2 == null || x2 == "" || x3 == null || x3 == "" ||
                        x4 == null || x4 == ""  || p1 == null || p2 == null || p1 == "" || p1 != p2){
                    alert('Enter valid inputs!');
                    return false;
                }
            }
        </script>
        
                 <script type="text/javascript">

</script>
    </head>

    <body class="direction-left">

        <!-- STARS -->
        <div class="stars large"></div>
        <div class="stars small"></div>
        <!-- /STARS -->

        <!-- SHOW THIS PART AS LOGIN PAGE (BEGIN) -->	
        <div id="content">

            <!-- PANEL -->
            <div class="panel">



                <!-- LOGIN -->
                <div id="subscribe">

                    <!-- LOGIN FORM (BEGIN) -->
                    <form id="subscribe-form" action="/MyCityWeb/User/registerAction" method="post" name='RegisterForm' onsubmit="return validateForm();">
                        <div class='register-img'><img src='/MyCityWeb/img/20.jpg'></img></div>
                        <input type="text" class='register' dir='ltr' autofocus='true' style='width:230px; height:38px; margin-bottom:5px; float:left;' name="name" placeholder="Your name..."/>
                        <br class='clear'/>
                        <input type="text" class='register' dir='ltr' style='width:230px; height:38px; margin-bottom:5px; float:left;' name="sname" placeholder="Surname..."/>
                        <br class='clear'/>
                        <input type="text" class='register' dir='ltr' style='width:230px; height:38px; margin-bottom:5px; float:left;' name="email" placeholder="E-mail..."/>
                        <br class='clear'/>
                        <input type="text" class='register' dir='ltr' autofocus='true' style='width:230px; height:38px; margin-bottom:5px; float:left;' name="username" placeholder="Choose a username..."/>
                
                        <br class='clear' />
                        <input type="password" class='register' dir='ltr' style='width:230px; height:38px; margin-bottom:5px; float:left;' name="password1" placeholder="Set a password..."/>
                        <br class='clear'/>
                        <input type="password" class='register' dir='ltr' autofocus='true' style='width:230px; height:38px; margin-bottom:5px; float:left;' name="password2" placeholder="Re-type password..."/>
                        <br class='clear'/>
                        <input type="submit" id="subscribe-button" style='width:240px; float:left;' value="REGISTER" />
                    </form>
                    <!-- /LOGIN FORM (END) -->
                </div>
                <!-- /LOGIN -->

                <!-- /POST SCRIPTUM -->
            </div>

            <!-- REGISTER -->
            <div class='footer-bar'>
                <div class="countdown">
                    <div class="countdown-text">
                        <span style='color:#8CC5F2;'><a href="/MyCityWeb/login.jsp">Login Page</a></span>
                    </div>
                </div>
            </div>
            
                                            <%String fail = request.getParameter("registerFailed");
                                            if (fail != null) {%>
                                <div class='footer-bar'>
                                    <div class="countdown">


                                        <div class="countdown-text">
                                            <span  style='color:red;'>REGISTER FAILED!</span>
                                        </div>

                                    </div>
                                </div>
                                <%}%>
            <!-- REGISTER -->

        </div>

        <!-- FOOTER (BEGIN) -->

        <!-- FOOTER (END) -->

    </body>
</html>
